package com.wenhua.mapper;
import com.wenhua.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    //查询用户id方法
    //返回值为用户id,如果没有就返回-1
    @Select("SELECT * FROM Users WHERE username = #{username} AND password = #{password}")
    public User selectUserByUsernameAndPasswordHash(String username, String password);

    //查询用户权位方法
    @Select("SELECT * FROM Users WHERE user_id = #{userId}")
    public User selectUserById(Integer userId);
}
